package com.cleaningcloud.erp.domain;

import com.cleaningcloud.common.core.annotation.Excel;
import com.cleaningcloud.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 销售单对象 erp_sale
 *
 * @author cleaningcloud
 * @date 2024-10-02
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ErpSale extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 销售ID
     */
    private Long saleId;

    /**
     * 销售单号
     */
    @Excel(name = "销售单号", sort = 1)
    private String saleOdd;

    /**
     * 仓库id
     */
    private Long wareId;

    /**
     * 客户ID
     */
    private Long customerId;

    /**
     * 销售时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "销售日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 3)
    private Date saleTime;

    /**
     * 销售人ID
     */
    private Long salePersonId;

    /**
     * 物流费用
     */
    @Excel(name = "物流费用", sort = 4)
    private BigDecimal logisticsCost;

    /**
     * 物流费用分摊方式(1按重量分摊2按体积分摊)
     */
    private Long logisticsMethod;

    /**
     * 其他费用
     */
    @Excel(name = "其他费用", sort = 5)
    private BigDecimal otherCost;

    /**
     * 其他费用分摊方式(1按重量分摊2按体积分摊)
     */
    @Excel(name = "其他费用分摊方式(1按重量分摊2按体积分摊)")
    private Long otherMethod;

    /**
     * 应收金额
     */
    @Excel(name = "销售金额", sort = 9)
    private BigDecimal payAmount;

    @Excel(name = "销售利润", sort = 10)
    private BigDecimal rateMoney;

    /**
     * 物流状态(0未发货1已发货2已收货)
     */
    @Excel(name = "物流状态", sort = 6, readConverterExp = "0=未发货,1=已发货,2=已收货")
    private String logisticsStauts;

    /**
     * 附件
     */
    private String attr;

    /**
     * 创建人ID
     */
    private Long createId;

    /**
     * 创建人名称
     */
    @Excel(name = "创建人", sort = 11)
    private String createName;

    /**
     * 备注是否关闭
     */
    private String flag;

    /**
     * 审批人ID
     */
    private Long approveId;

    /**
     * 审批人名称
     */
    @Excel(name = "审批人", sort = 10)
    private String approveName;

    /**
     * 审批时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 12)
    private Date approveTime;

    /**
     * 驳回时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date rejectTime;

    /**
     * 驳回原因
     */
    private String rejectReason;

    /**
     * 销售状态(0草稿1待审批2已通过3被驳回4已完成)
     */
    @Excel(name = "销售状态", sort = 13, readConverterExp = "0=草稿,1=待审批,2=已通过,3=被驳回,4=已完成,5=已取消")
    private Long saleStatus;

    /**
     * 销售批次
     */
    private Integer saleBatch;

    /**
     * 取消时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date cancelTime;
}
